
abstract class IStore {
  /// 初始化方法
  Future<void> init();

  /// 获取字符串
  String getString(String key, {String def = "", String? name});

  /// 设置字符串
  bool setString(String key, String value, {String? name});

  /// 获取整数
  int getInt(String key, {int def = 0, String? name});

  /// 设置整数
  bool setInt(String key, int value, {String? name});

  /// 获取浮点数
  double getDouble(String key, {double def = 0.0, String? name});

  /// 设置浮点数
  bool setDouble(String key, double value, {String? name});

  /// 设置布尔值
  bool setBool(String key, bool value, {String? name});

  /// 获取布尔值
  bool getBool(String key, {bool def = false, String? name});

  /// 获取字符串列表
  List<String> getStringList(String key, {List<String> def = const [], String? name});

  bool setStringList(String key, List<String> value, {String? name});

  /// 获取键值对
  Map getMap(String key, {Map def = const {}, String? name});

  bool setMap(String key, Map value, {String? name});

  /// 判断是否存在键值对
  bool contains(String key, {String? name});

  /// 删除键值对
  bool remove(String key, {String? name});

  /// 清空所有数据
  void clear({String? name});
}
